Field of the Invention
The present invention generally relates to technical computing, and, more particularly, to generating automatically an object-oriented, textual representation of a graphical model, and performing verification testing of the textual representation and the graphical model.
Background Information
Block diagrams are used to model real-world systems. Historically, engineers and scientists have utilized time-based block diagram models in numerous scientific areas, such as Feedback Control Theory and Signal Processing to study, design, debug, and refine dynamic systems. Dynamic systems, which are characterized by the fact that their behaviors change over time, are representative of many real-world systems. A dynamic system (either natural or man-made) is a system whose response at any given time is a function of its input stimuli, its current state, and the current time. Such systems range from simple to highly complex systems. Physical dynamic systems include, for example, a falling body, the rotating earth, biomechanical systems (muscles, joints, etc.), biochemical systems (gene expression, protein pathways), and weather and climate pattern systems. Examples of man-made or engineered dynamic systems include: a bouncing ball, a spring with a mass tied on an end, automobiles, airplanes, control systems in major appliances, communication networks, audio signal processing, nuclear reactors, and a stock market.
A block diagram model of a dynamic system is represented schematically as a collection of blocks interconnected by lines that represent signals. Each block represents an elemental dynamic system. A signal represents either the input or the output of a dynamic system. A line emanating at one block and terminating at another signifies that the output of the first block is an input to the second block. Each distinct input or output on a block is referred to as a “port”. Signals correspond to the time-varying quantities represented by each line connection and are assumed to have values at each time instant at which the connecting blocks are enabled. The source block of a signal writes to the signal at a given time instant when its system equations are solved. The destination blocks of this signal read from the signal when their system equations are being solved.
It should be noted that the term “block diagram,” as used herein, also refers to other graphical modeling formalisms. For instance, flow-charts are block diagrams of entities that are connected by relations. Flow-charts are used to capture process flow and are not generally suitable for describing dynamic system behavior. Data flow block diagrams are diagrams of entities with relations between them that describe a graphical programming paradigm where the availability of data is used to initiate the execution of blocks, where a block represents an operation and a line represents execution dependency describing the direction of data flowing between blocks. It will be appreciated that a block diagram model may include entities that are based on other modeling domains within the block diagram. A common characteristic among these various forms of block diagrams is that they define semantics on how to execute them.
In graphical modeling environments, such as model-based design tools, block diagram models can be created to represent a design, or algorithm, of an implementation for a computational hardware. One or more block diagram models may represent a design for a target hardware platform. A target hardware platform used in this application may include a single computing platform or multiple computing platforms. A target hardware platform may also have other elements such as memory, interfaces, or other integrated circuits (ICs). An automatic code generation application can automatically generate code and build programs from the block diagram model for implementation on the target hardware platform based on the design specified by the model. In this manner, the design of a block diagram model behaves as an implementation specification for automatic code generation. A graphical block diagram modeling environment can be used to produce designs and algorithms that can be implemented on a processor or computational IC, such as an FPGA or ASIC.
In conventional systems, users typically have no convenient way to verify that automatically generated code from a block diagram model will execute in an intended manner on a target platform, e.g., in a manner consistent with a design implemented in the block diagram model.